# -*- encoding: utf-8 -*-

import pprint
from difflib import SequenceMatcher
from cluster import HierarchicalClustering

# 输入 urls
urls = [
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/articleList/rolls/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/photo.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2015/wxghz/index.htm',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/a/20170620/035592.htm',
'http://news_and_blog.qq.com/a/20170619/047190.htm',
'http://news_and_blog.qq.com/a/20170620/007028.htm',
'http://news_and_blog.qq.com/a/20170620/041852.htm',
'http://news_and_blog.qq.com/a/20170620/041852.htm',
'http://news_and_blog.qq.com/a/20160730/000170.htm',
'http://news_and_blog.qq.com/a/20160418/023091.htm',
'http://news_and_blog.qq.com/a/20160418/023092.htm',
'http://news_and_blog.qq.com/a/20160418/023093.htm',
'http://news_and_blog.qq.com/a/20170614/026418.htm',
'http://news_and_blog.qq.com/a/20170613/038444.htm',
'http://news_and_blog.qq.com/a/20170620/023689.htm',
'http://news_and_blog.qq.com/a/20170620/023689.htm',
'http://news_and_blog.qq.com/a/20170620/023689.htm',
'http://news_and_blog.qq.com/a/20170620/023689.htm',
'http://news_and_blog.qq.com/a/20170620/039097.htm',
'http://news_and_blog.qq.com/a/20170620/039097.htm',
'http://news_and_blog.qq.com/a/20170620/042347.htm',
'http://news_and_blog.qq.com/a/20170620/042347.htm',
'http://news_and_blog.qq.com/a/20170620/012054.htm',
'http://news_and_blog.qq.com/a/20170620/012054.htm',
'http://news_and_blog.qq.com/a/20170620/036962.htm',
'http://news_and_blog.qq.com/a/20170620/036962.htm',
'http://news_and_blog.qq.com/a/20170620/018848.htm',
'http://news_and_blog.qq.com/a/20170620/018848.htm',
'http://news_and_blog.qq.com/a/20170620/041967.htm',
'http://news_and_blog.qq.com/a/20170620/041967.htm',
'http://news_and_blog.qq.com/a/20170620/037919.htm',
'http://news_and_blog.qq.com/a/20170620/037919.htm',
'http://news_and_blog.qq.com/a/20170620/034152.htm',
'http://news_and_blog.qq.com/a/20170620/034152.htm',
'http://news_and_blog.qq.com/a/20170620/032017.htm',
'http://news_and_blog.qq.com/a/20170620/032017.htm',
'http://news_and_blog.qq.com/a/20170620/032017.htm',
'http://news_and_blog.qq.com/a/20170620/032017.htm',
'http://news_and_blog.qq.com/a/20170620/002786.htm',
'http://news_and_blog.qq.com/a/20170620/002786.htm',
'http://news_and_blog.qq.com/a/20170620/001124.htm',
'http://news_and_blog.qq.com/a/20170620/001124.htm',
'http://news_and_blog.qq.com/a/20170620/002049.htm',
'http://news_and_blog.qq.com/a/20170620/002049.htm',
'http://news_and_blog.qq.com/a/20170620/001834.htm',
'http://news_and_blog.qq.com/a/20170620/001834.htm',
'http://news_and_blog.qq.com/a/20170619/058240.htm',
'http://news_and_blog.qq.com/a/20170619/058240.htm',
'http://news_and_blog.qq.com/a/20170620/000595.htm',
'http://news_and_blog.qq.com/a/20170620/000595.htm',
'http://news_and_blog.qq.com/a/20170620/002511.htm',
'http://news_and_blog.qq.com/a/20170620/002511.htm',
'http://news_and_blog.qq.com/a/20170619/020398.htm',
'http://news_and_blog.qq.com/a/20170619/020398.htm',
'http://news_and_blog.qq.com/a/20170619/047028.htm',
'http://news_and_blog.qq.com/a/20170619/047028.htm',
'http://news_and_blog.qq.com/a/20170619/052335.htm',
'http://news_and_blog.qq.com/a/20170619/052335.htm',
'http://news_and_blog.qq.com/a/20170619/052335.htm',
'http://news_and_blog.qq.com/a/20170619/052335.htm',
'http://news_and_blog.qq.com/a/20170620/031783.htm',
'http://news_and_blog.qq.com/a/20170620/025819.htm',
'http://news_and_blog.qq.com/a/20170620/037358.htm',
'http://news_and_blog.qq.com/a/20170620/033826.htm',
'http://news_and_blog.qq.com/a/20170620/023845.htm',
'http://news_and_blog.qq.com/a/20170620/024038.htm',
'http://news_and_blog.qq.com/a/20170620/036089.htm',
'http://news_and_blog.qq.com/a/20170620/039644.htm',
'http://news_and_blog.qq.com/a/20170620/038564.htm',
'http://news_and_blog.qq.com/a/20170620/036969.htm',
'http://news_and_blog.qq.com/a/20170620/035846.htm',
'http://news_and_blog.qq.com/a/20170620/029267.htm',
'http://news_and_blog.qq.com/a/20170620/024934.htm',
'http://news_and_blog.qq.com/a/20170620/034622.htm',
'http://news_and_blog.qq.com/society_index.shtml',
'http://news_and_blog.qq.com/a/20170620/037310.htm',
'http://news_and_blog.qq.com/a/20170620/032692.htm',
'http://news_and_blog.qq.com/a/20170620/022522.htm',
'http://news_and_blog.qq.com/a/20170620/008126.htm',
'http://news_and_blog.qq.com/a/20170620/012790.htm',
'http://news_and_blog.qq.com/a/20170620/015473.htm',
'http://news_and_blog.qq.com/a/20170620/010623.htm',
'http://news_and_blog.qq.com/a/20170620/011239.htm',
'http://news_and_blog.qq.com/a/20170620/011471.htm',
'http://news_and_blog.qq.com/a/20170620/019051.htm',
'http://news_and_blog.qq.com/a/20170620/010205.htm',
'http://news_and_blog.qq.com/a/20170620/012064.htm',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/articleList/rolls/',
'http://news_and_blog.qq.com/',
'http://view.inews.qq.com/a/20170619A064W500',
'http://view.inews.qq.com/a/20170620A00PLC00',
'http://view.inews.qq.com/a/HIS2017062000767400',
'http://view.inews.qq.com/a/20170619A08LQ900',
'http://view.inews.qq.com/a/20170619A0A9OR00',
'http://view.news_and_blog.qq.com/original/legacyintouch/d646.html',
'http://media.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photon/bigpic.htm',
'http://news_and_blog.qq.com/l/photon/list20100920155222.htm',
'http://news_and_blog.qq.com/l/photon/list20100920155426.htm',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/articleList/rolls/',
'http://news_and_blog.qq.com/original/dujiabianyi/neirongye.html',
'http://news_and_blog.qq.com/original/dujiabianyi/shenyeshitang.html',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/zt2014/fact/index.htm',
'http://news_and_blog.qq.com/a/20150612/037664.htm',
'http://news_and_blog.qq.com',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/l/milite/gaoqingtuku/list20110125183430.htm',
'http://news_and_blog.qq.com/photon/photostory/eyhz.htm',
'http://news_and_blog.qq.com/photon/living.htm',
'http://news_and_blog.qq.com/photon/tuhua.htm',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/photo.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/original/dujiabianyi/meitirenshe.html',
'http://news_and_blog.qq.com/original/dujiabianyi/teamlab.html',
'http://news_and_blog.qq.com/original/dujiabianyi/piyouzhimeiyuyouxiandianshi.html',
'http://view.news_and_blog.qq.com/original/intouchtoday/n3928.html',
'http://view.news_and_blog.qq.com/original/intouchtoday/n3927.html',
'http://news_and_blog.qq.com/a/20150617/051374.htm',
'http://news_and_blog.qq.com/a/20150618/026094.htm',
'http://news_and_blog.qq.com/a/20150616/030079.htm',
'http://news_and_blog.qq.com/a/20150617/029297.htm',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://history.news_and_blog.qq.com/',
'http://view.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/mchat/p/20150407/10002978.html',
'http://view.news_and_blog.qq.com/l/history_new/history_article/list201206115621.htm',
'http://view.news_and_blog.qq.com/a/20170614/016572.htm',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/jdrw/index.html',
'http://news_and_blog.qq.com/photon/photoex.htm',
'http://news_and_blog.qq.com/photon/selective/wqhz.htm',
'http://news_and_blog.qq.com/photon/feature.htm',
'http://news_and_blog.qq.com/a/20170620/023689.htm',
'http://news_and_blog.qq.com/original/oneday/2728.html',
'http://news_and_blog.qq.com/a/20170620/009443.htm',
'http://news_and_blog.qq.com/a/20170620/013006.htm',
'http://news_and_blog.qq.com/a/20170620/011720.htm',
'http://news_and_blog.qq.com/a/20170620/010154.htm',
'http://news_and_blog.qq.com/original/oneday/2727.html',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/zt2015/wxghz/index.htm',
'http://news_and_blog.qq.com/a/20170620/013006.htm',
'http://news_and_blog.qq.com/a/20170620/024038.htm',
'http://news_and_blog.qq.com/a/20170620/037142.htm',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/original/dujiabianyi/xingzuo.html',
'http://news_and_blog.qq.com/a/20170302/019069.htm',
'http://news_and_blog.qq.com/a/20170302/019069.htm',
'http://news_and_blog.qq.com/a/20170115/012771.htm',
'http://view.news_and_blog.qq.com/original/intouchtoday/n3926.html',
'http://view.news_and_blog.qq.com/original/intouchtoday/n3925.html',
'http://view.inews.qq.com/a/20170615A051Y300',
'http://view.inews.qq.com/a/20170613A078LV00',
'http://view.inews.qq.com/a/20170614A06YLO00',
'http://news_and_blog.qq.com/zt2014/fact/index.htm',
'http://view.news_and_blog.qq.com/l/tuijian/list2012052515424.htm',
'http://news_and_blog.qq.com/a/20150626/027509.htm',
'http://news_and_blog.qq.com/a/20150619/029516.htm',
'http://news_and_blog.qq.com/a/20150623/025983.htm',
'http://news_and_blog.qq.com/a/20150629/024627.htm',
'http://news_and_blog.qq.com/a/20150625/028671.htm',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://view.news_and_blog.qq.com/a/20170614/009659.htm',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/20170608A0067Y00',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/20170607A09DA400',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/HIS2017060700934000',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/20170607A0BRLD00',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/20170608A03DXL00',
'http://view.news_and_blog.qq.com/a/20170605/026173.htm',
'http://view.news_and_blog.qq.com/a/20170602/022195.htm',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/a/20170619/008304.htm',
'http://news_and_blog.qq.com/a/20170619/006540.htm',
'http://news_and_blog.qq.com/a/20170619/012082.htm',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/a/20170620/008126.htm',
'http://news_and_blog.qq.com/a/20170620/033736.htm',
'http://news_and_blog.qq.com/a/20170620/013127.htm',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/a/20170308/022622.htm',
'http://news_and_blog.qq.com/a/20170308/022622.htm',
'http://news_and_blog.qq.com/a/20170126/018592.htm',
'http://news_and_blog.qq.com/a/20170117/029013.htm',
'http://view.news_and_blog.qq.com/',
'http://view.news_and_blog.qq.com/original/intouchtoday/n3928.html',
'http://view.news_and_blog.qq.com/original/intouchtoday/n3928.html',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/newsgn/zhxw/shizhengxinwen.htm',
'http://view.news_and_blog.qq.com/a/20170526/029953.htm',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/20170511A0APAN00',
'http://view.news_and_blog.qq.comhttp://view.inews.qq.com/a/20170512A007N800',
'http://view.news_and_blog.qq.com/a/20170327/008129.htm',
'http://view.news_and_blog.qq.com/a/20170327/000215.htm',
'http://view.news_and_blog.qq.com/a/20170322/002490.htm',
'http://view.news_and_blog.qq.com/zt2015/jianren/index.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E9%BA%BB%E8%8D%AF',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E6%99%BA%E5%8A%9B',
'http://news_and_blog.qq.com/a/20170618/016999.htm',
'http://news_and_blog.qq.com/a/20170618/026443.htm',
'http://news_and_blog.qq.com/photon/living.htm',
'http://news_and_blog.qq.com/original/living/l677_2.html',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E4%B8%B9%E9%BA%A6',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E7%94%9F%E8%9A%9D',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E7%AD%BE%E8%AF%81',
'http://news_and_blog.qq.com/a/20170620/017050.htm',
'http://news_and_blog.qq.com/a/20170620/023689.htm',
'http://news_and_blog.qq.com/a/20170620/024748.htm',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/newsgn/zhxw/shizhengxinwen.htm',
'http://news_and_blog.qq.com/a/20160729/018387.htm',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/newssh/shwx/shehuiwanxiang.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E7%89%A9%E4%BB%B7',
'http://news_and_blog.qq.com',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E4%B8%AD%E7%BE%8E%E5%A4%96%E4%BA%A4%E5%AE%89%E5%85%A8%E5%AF%B9%E8%AF%9D',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E5%8D%97%E6%B5%B7%E9%97%AE%E9%A2%98',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E5%8F%8D%E6%81%90',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E6%9C%9D%E6%A0%B8%E9%97%AE%E9%A2%98',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://view.news_and_blog.qq.com/zt2015/jianren/index.htm',
'http://news_and_blog.qq.com/zt2011/xinhai/minsheng.htm',
'http://news_and_blog.qq.com/zt2011/xinhai/minsheng.htm',
'http://news_and_blog.qq.com/zt2011/zxzgjcy/index.htm',
'http://news_and_blog.qq.com/zt2011/zxzgjcy/index.htm',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E4%BC%A4%E5%8F%A3%E6%84%88%E5%90%88',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E5%B0%8F%E5%AD%A9',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/photon/living.htm',
'http://news_and_blog.qq.com/original/living/l675.html',
'http://news_and_blog.qq.com/photon/living.htm',
'http://news_and_blog.qq.com/original/living/l674.html',
'http://news_and_blog.qq.com/original/oneday/2728.html',
'http://news_and_blog.qq.com/original/oneday/2727.html',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/a/20170620/007454.htm',
'http://news_and_blog.qq.com/a/20170619/047028.htm',
'http://news_and_blog.qq.com/a/20170620/003533.htm',
'http://news_and_blog.qq.com/a/20170620/001562.htm',
'http://news_and_blog.qq.com/a/20160725/004244.htm',
'http://news_and_blog.qq.com/a/20160724/003258.htm',
'http://news_and_blog.qq.com/a/20160724/002694.htm',
'http://news_and_blog.qq.com/a/20160824/016627.htm?tu_type=1',
'http://news_and_blog.qq.com/a/20160824/036717.htm?tu_type=1',
'http://news_and_blog.qq.com/a/20160824/039189.htm?tu_type=1',
'http://view.news_and_blog.qq.com/original/legacyintouch/d646.html',
'http://view.news_and_blog.qq.com/',
'http://view.news_and_blog.qq.com/a/20170620/010932.htm',
'http://view.news_and_blog.qq.com/a/20170620/010791.htm',
'http://view.news_and_blog.qq.com/a/20170620/010656.htm',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E8%85%BE%E8%AE%AF%E6%96%B0%E9%97%BB',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E6%96%B0%E9%97%BB%E9%93%81%E5%86%9B',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E6%89%A9%E5%A4%A7',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=CPI',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/world_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/newssh/shwx/shehuiwanxiang.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E6%9B%B9%E5%BE%B7%E6%97%BA',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/original/oneday/2726.html',
'http://news_and_blog.qq.com/photon/tuhua.htm',
'http://news_and_blog.qq.com/a/20170620/019821.htm',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/photo.shtml',
'http://news_and_blog.qq.com/a/20170620/010154.htm',
'http://news_and_blog.qq.com/original/oneday/2728.html',
'http://news_and_blog.qq.com/a/20170620/013006.htm',
'http://news_and_blog.qq.com/a/20170620/009443.htm',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/society_index.shtml',
'http://view.news_and_blog.qq.com/',
'http://history.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/photo.shtml',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E7%BE%8E%E5%9B%BD',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E5%91%98%E5%B7%A5',
'http://news_and_blog.qq.com/newssh/shwx/shehuiwanxiang.htm',
'http://news_and_blog.qq.com/zt2015/2015lh/index.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E5%A4%AE%E8%A7%86',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E9%AB%98%E8%80%83',
'http://news_and_blog.qq.com/original/tuhua/tuhaojin.html',
'http://news_and_blog.qq.com/photon/tuhua.htm',
'http://news_and_blog.qq.com/original/tuhua/wushu.html',
'http://news_and_blog.qq.com/photon/tuhua.htm',
'http://news_and_blog.qq.com/a/20170619/009756.htm',
'http://news_and_blog.qq.com/a/20170619/007301.htm',
'http://news_and_blog.qq.com/a/20170620/011720.htm',
'http://view.inews.qq.com/a/20170613A078LV00',
'http://view.inews.qq.com/a/20170613A078LV00',
'http://view.inews.qq.com/a/20170614A06YLO00',
'http://view.inews.qq.com/a/20170613A03NY600',
'http://view.inews.qq.com/a/20170612A065L900',
'http://view.inews.qq.com/a/20170611A03T5V00',
'http://news_and_blog.qq.com/zt2017/thirteen_in/allpc.htm',
'http://media.news_and_blog.qq.com/mediaplus/home.htm',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://weather.news_and_blog.qq.com/',
'http://news_and_blog.qq.com/newssh/shwx/shehuiwanxiang.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E5%81%87%E5%A9%9A%E5%A7%BB',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/dc_article2016/tagsList.htm?tags=%E9%82%BB%E5%B1%85',
'http://news_and_blog.qq.com/',
'http://news_and_blog.qq.com/zt2014/2014qtnews/ccybspxd.htm',
'http://news_and_blog.qq.com/original/tuhua/spacedelivery.html',
'http://news_and_blog.qq.com/photon/photostory/eyhz.htm',
        ]

# 计算url之间的距离
# 使用difflib中的SequenceMatcher计算
def distance(url1, url2):
    ratio = SequenceMatcher(None, url1, url2).ratio()
    return 1.0 - ratio
# 执行层次聚类
hc = HierarchicalClustering(urls, distance)
clusters = hc.getlevel(0.2)
pprint.pprint(clusters)